<template>
  <div class="container">
    <div class="line" @click="navigateTo('/pages/example/button')">按钮</div>
    <div class="line" @click="clickHandle('test click', $event)">点击获取参数</div>
    <div class="line" @click="navigateTo('/pages/example/counter')">Vuex示例页面</div>
    <div class="line" @click="navigateTo('/pages/example/wxParse')">文章-富文本</div>
    <div class="line" @click="navigateTo('/pages/example/components')">组件</div>
  </div>
</template>

<script>

  import { getList } from '@/api/sample';
  import iconfontObj from '@/assets/font/iconfont.json';

  export default {
    mpType: 'page',

    data() {
      return {
        motto: 'Hello World',
        iconfontObj,
      };
    },

    created() {
      // this.network().getList(); // 调用应用实例的方法获取全局数据
    },

    methods: {
      clickHandle(msg, ev) {
        console.log('clickHandle:', msg, ev);
      },
      bindViewTap() {
        this.$router.push('/packageA/logs');
      },
      network() {
        return {
          getList: async () => {
            const { data } = await getList()
            console.log(data);
          },
        };
      },
      handler() {
        return {
          example: () => {
            console.log('handle');
          },
        };
      },
    },
  };
</script>

<style lang="scss" scoped>
  .container {
    padding: 20rpx;
    .line {
      display: flex;
      flex-wrap: wrap;
      & + .line {
        margin-top: 20rpx;
      }
    }
  }
</style>
